<template>
  <el-container style="height: 850px">
    <el-header style="height: 10%;background-color: rgb(72,209,204);">
      <div style="background-color: rgb(72,209,204);width: 33%;height: 100%;float: left"></div>
      <div style="background-color: rgb(72,209,204);width: 34%;height: 100%;float: left"> <p style="color: #91959c;font-size: 23px;line-height: 23px;font-weight: bold;height: 40px">后台管理</p></div>
      <div style="background-color: rgb(72,209,204);width: 33%;height: 100%;float: left" >  <el-button type="danger" plain  @click="jump('Index')">返回主页</el-button></div>
    </el-header>
    <el-container style="height: 70%">
      <el-aside width="300px">
        <el-menu default-active="1-4-1" class="el-menu-vertical-demo"  background-color="#fff"  @open="handleOpen" @close="handleClose" style="background-color: white;width:299px;height: 100% ">
          <el-submenu index="1" style="background-color: black">
            <template slot="title"  >
              <i style="font-size: 23px;color: slategray;font-style: normal;font-weight: bold">个人信息管理</i>
            </template>
            <el-menu-item-group  class="hh" >
              <el-menu-item index="1-1" @click="jump('Info')"><p style="font-size: 15px;color: slategray;line-height: 0px;margin: 0px">信息查看</p></el-menu-item>
              <el-menu-item index="1-2"  @click="jump('UpInfo')"><p style="font-size: 15px;color: slategray;line-height: 0px;margin: 0px">信息修改</p></el-menu-item>
              <!--<el-menu-item index="1-3"@click="deinfo"><p style="font-size: 15px;color: slategray;line-height: 0px;margin: 0px">信息删除</p></el-menu-item>-->
            </el-menu-item-group>

          </el-submenu>
          <el-submenu index="2" >
            <template slot="title">
              <i style="font-size: 23px;color: slategray;font-style: normal;font-weight: bold">签到管理</i>
            </template>
            <el-menu-item-group class="hh" style="font-size: 23px">
              <el-badge :value=leirong class="item" style="margin: 0px">
                <el-menu-item index="2-1" style="margin: 0px"   @click="jump('QianDao')"><p style="font-size: 15px;color: slategray;line-height: 0px;margin: 0px">签到</p></el-menu-item>
              </el-badge>
              <el-menu-item index="2-4-1"   @click="jump('ProjectManage')" ><p style="font-size: 15px;color: slategray;line-height: 0px;margin: 0px">查看申请中的项目</p></el-menu-item>
            </el-menu-item-group>
          </el-submenu>

        </el-menu>
      </el-aside>
      <el-main style="padding: 0px;height: 845px">
        <router-view ></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
  export default {
    data() {
      return {
        leirong:'',
        user:{},
        id:'',
        wid:'',
        role:'',
        role1:''
      };
    },
    mounted: function(){
      var user= JSON.parse(window.sessionStorage.getItem("user"));

      this.id=user.id

      axios.post('/user/findGroupByUid',{
        id:28,
        uid:28
      }).then((response) => {
        let ee=response.data
        console.log(ee)

        this.user=ee

        if(this.user.starttime!=null){
          this.leirong='new'
        }


      }).catch((response)=>{

      })






    },
    methods: {
      jump(path){
        this.$router.replace({path:path})
      },
      deinfo(){
        axios.post('/factory/deInfo',{
          id : this.id,
          hh : this.id
        }).then((response) => {
          console.log(response.data);
          if( response.data != 800){
            this.$notify({
              title: '成功',
              message: '成功',
              type: 'success',
              duration:2000
            });
            //  window.sessionStorage.setItem("user", JSON.stringify(response.data.user));
            // var token= window.sessionStorage.getItem("token");
            //var user= JSON.parse(window.sessionStorage.getItem("user"));
            this.$router.replace({path:'DeInfo'})
          }
          else{
            this.$notify({
              title: '失败',
              message: '错误',
              type: 'warning',
              duration:2000
            });
          }
        }) },
      jumpp(path){
        this.$router.push({
          path: path,
          query: {
            mallCode: this.wid,
          }
        })},



      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      },
    }}
</script>
<style >
  .item {
    margin-top: 0px;
    margin-right: 10px;
  }
  .el-menu-vertical-demo:not(.el-menu--collapse) {
    width: 200px;
    min-height: 400px;
  }

  .el-header, .el-footer {
    color: #7c235b;
    text-align: center;
    line-height: 60px;
  }

  .el-aside {
    background-color: #c0c3bf;
    color: #333;
    line-height: 0px;
    font-size: 25px;
    font-weight: bold;
    text-align: left;
  }

  .el-main {
    background-color: #e0e4eb;
    color: #333;
    text-align: center;
    line-height: 60px;
  }

  body > .el-container {
    margin-bottom: 40px;
  }
  . hh{
    height: 56px;
    line-height: 56px;
    position: relative;
    -webkit-box-sizing: border-box;
    white-space: nowrap;
  }
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  .el-menu-item, .el-submenu__title {
    height: 56px;
    line-height: 56px;
    position: relative;
    -webkit-box-sizing: border-box;
    white-space: nowrap;
    padding-left: 100px;
    /*list-style-position: initial;*/
    list-style-type: initial ;
  }
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>
